#@adminLayout() #define main()

<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="config-form">
                <div class="select-list">
                    <ul>
                        <li>
                            	类型：
                            	<select name="status" id="status" style="width:80px">
                            		<option value="all">全部</option>
                            	</select>
                        </li>
                        <li>
                            	描述：<input type="text" name="description"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <!-- <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()">
                <i class="fa fa-remove"></i> 删除
            </a>
        </div> -->
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<script type="text/javascript">
    var prefix ="#(ctx)/syslog";

    $(function() {
    	bindStatus();
    	
        var options = {
            url: prefix + "/list",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            uniqueId: "id",
            sortName: "sort",
            sortOrder: "asc",
            modalName: "参数",
            columns: [/* {
                checkbox: true
            }, */
                {
                    field: 'enddate',
                    title: '操作日期'
                },
                {
                    field: 'userids',
                    title: '操作人'
                },
                {
                    field: 'status',
                    title: '操作类型'
                },
                {
                    field: 'ips',
                    title: '操作IP'
                },
                {
                    field: 'method',
                    title: '请求类型'
                },
                {
                    field: 'osname',
                    title: '操作系统'
                },
                {
                    field: 'uaname',
                    title: '浏览器'
                },
                {
                    field: 'description',
                    title: '操作描述'
                },
                /* 
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-danger btn-xs " href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                } */]
        };
        $.table.init(options);
    });
    
    function bindStatus()
    {
    	$.getJSON(prefix+"/getStatus",function(arr){
	    	$.each(arr, function (i, val) {
		   		var $append = $("<option value='" + val.ccode + "'>" + val.cname + "</option>");
		   		$("#status").append($append);
	   		});
    	});
    }
</script>
</body>
#end